function x = jacobi(A,b,error)
%Jacobi 此处显示有关此函数的摘要
%   error为误差
n = size(A,1);
D = diag(diag(A));
B = D\(D-A);
g = D\b;
x0 =zeros(n,1);
x = g;
while norm(x-x0) > error
    x0 = x;
    x = B*x + g;
end
end

